﻿angular.module('picShare').directive('sayHello', function (userDataSvc) {
    return {
        restrict: 'C',
        templateUrl: "/Templates/Include-Templates/hello.html",
        link: function (scope, element, attrs, controller) {
            $scope.$watch(function () {
                return userDataSvc.user.userName;
            }, function (newVal) {
                if (newVal != "") {
                    scope.sayHello = "Hello " + newVal;
                }
            });
        }

    };
});